package cn.hwl.springframework.beans.factory.support;

import cn.hwl.springframework.core.io.DefaultResourceLoader;
import cn.hwl.springframework.core.io.ResourceLoader;

/**
 * @author :  HuangWL
 * @date :    2022/4/27 11:37
 * eanDefinitionReader 接口的前两个方法全部实现
 */
public abstract class AbstractBeanDefinitionReader implements BeanDefinitionReader {

    private final BeanDefinitionRegistry registry;

    private ResourceLoader resourceLoader;

    protected AbstractBeanDefinitionReader(BeanDefinitionRegistry registry){
        this(registry,new DefaultResourceLoader());
    }

    public AbstractBeanDefinitionReader(BeanDefinitionRegistry registry,ResourceLoader resourceLoader){
        this.registry = registry;
        this.resourceLoader = resourceLoader;
    }


    @Override
    public BeanDefinitionRegistry getRegistry() {
        return registry;
    }

    @Override
    public ResourceLoader getResourceLoader() {
        return resourceLoader;
    }

}
